<%--
  Created by IntelliJ IDEA.
  User: Server
  Date: 2015/5/25
  Time: 16:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>uploadify上传</title>
  <meta name="_csrf" content="${_csrf.token}"/>
  <meta name="_csrf_header" content="${_csrf.headerName}"/>
  <script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery-1.9.1.js"></script>
  <link rel="stylesheet" href="<%=request.getContextPath()%>/css/uploadify/uploadify.css">
  <script type="text/javascript" src="<%=request.getContextPath()%>/js/uploadify/jquery.uploadify.min.js"></script>
  <script >
    $(document).ready(function() {
      $("#file_upload").uploadify({
        'buttonText' : '请选择',
        'height' : 30,
        'swf' : '<%=request.getContextPath()%>/uploadify.swf?<%=request.getSession().getId()%>',
        'uploader' : '<%=request.getContextPath()%>/admin/fileUpload?${_csrf.parameterName}=${_csrf.token}',
        'width' : 120,
        'queueID':'fileQueue',
        'auto':false,
        'fileObjName'   : 'file',
        'onUploadSuccess' : function(file, data, response) {
          alert( file.name + ' 上传成功！ ');
        }
      });
    });
  </script>

</head>
<body>
<div id="fileQueue">
<input type="file" name="uploadify" id="file_upload" />
<hr>
<a href="javascript:$('#file_upload').uploadify('upload','*')">开始上传</a>
<a href="javascript:$('#file_upload').uploadify('cancel', '*')">取消所有上传</a>
</div>
</body>
</html>
